﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SpreadShoppingCart.aspx.cs" Inherits="JuseWeb.Vshop.SpreadShoppingCart" enableSessionState ="True" %>

<%@ Register TagPrefix="Hi" Namespace="Hidistro.UI.Common.Controls" Assembly="Hidistro.UI.Common.Controls" %>
<%@ Register TagPrefix="wnxd" Namespace="wnxd.Web" Assembly="wnxd.Web" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta content="telephone=no" name="format-detection">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>订单信息</title>
    <link type="text/css" rel="stylesheet" href="../SpreadCss/SpreadShoppingCart.css" />
    <script src="http://res.juseshop.com/utility/jquery-1.6.4.min.js" type="text/javascript"></script>
</head>
<body>
    <wnxd:Web runat="server" />
    <section class="item_sec">
        <div class="item_wrap rel">
            <ul>
                <li>
                    <img id="pImage" runat="server">
                </li>
            </ul>
            <ul>
                <li style="margin: 15px 0px 15px 0px;" class="i_pri"><b runat="server" id="pName"></b></li>
            </ul>
            <ul class="sku_ul" runat="server" id="sku_ul">
            </ul>
            <p class="row">
                <label>价　格 </label>
                <span class="i_pri" id="item_price">￥<span runat="server" id="pPrice"></span></span>
            </p>
            <p>
                <input type="radio" name="identity" value="货到付款" checked="checked" />货到付款并包邮
            </p>
        </div>
    </section>
    <section class="item_sec">
        <div class="item_wrap add">
            <p class="row">
                <label for="name">收货人</label>
                <input required="required" id="name" name="name" class="block input" tabindex="1" type="text" value="" />
            </p>
            <p class="row">
                <label for="tel">联系手机</label>
                <input required="required" id="tel" name="tel" maxlength="11" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();" class="block input" tabindex="2" type="tel" value="" />
            </p>
            <p class="row">
                <label for="province">选择地区</label>
                <Hi:RegionSelector runat="server" ID="dropRegions" />
            </p>
            <p class="row row_area">
                <label for="address">详细地址</label>
                <input required="required" id="address" name="xdz" class="block input" placeholder="街道门牌信息" tabindex="6" type="text" value="">
            </p>
        </div>
    </section>
    <footer>
        <button type="button" class="c_txt orange_bg" id="buy_now">提交订单</button>
    </footer>
    <script type="text/javascript">
        $("select[selectset='regions']").each(function () {
            $(this).parent().prev().remove();
        });
        $(".wnxd_a").click(function () {
            var $this = $(this);
            if ($this.is(".wnxd_active")) return;
            $(".wnxd_active").removeClass("wnxd_active");
            $this = $this.addClass("wnxd_active").parent();
            $("#pName").text($this.attr("name"));
            $("#pPrice").text($this.attr("price"));
            $("#pImage").attr("src", $this.attr("image"));
        });
        $("#buy_now").click(function () {
            var name = $("#name").val(),
                tel = $("#tel").val(),
                region = $("#regionSelectorValue").val(),
                address = $("#address").val();
            if ($.trim(name) == "") {
                alert("请输入正确的收货人姓名");
            }
            else if ($.trim(tel) == "") {
                alert("请输入正确的手机号码");
            }
            else if ($.trim(region) == "") {
                alert("请选择收货地址");
            }
            else if ($.trim(address) == "") {
                alert("请输入收货人详细地址");
            }
            else {
                $.post(location.href, "wnxd_ajax=Submit&SkuId=" + $(".wnxd_active").parent().attr("skuid") + "&name=" + name + "&tel=" + tel + "&address=" + address + "&region=" + region, function (e) {
                    if (e.error) {
                        alert(e.msg);
                    }
                    else {
                        location.href = e.url;
                    }
                }, "json");
            }
        });
    </script>
</body>
</html>
